﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Microsoft.WindowsAzure.Search
{
    public class QueryParser
    {
        public static List<String> Parse(String input)
        {
            List<String> queryTerms = Parser.Parse(input);
            queryTerms.Sort();

            List<String> uniqueQueryTerms = new List<String>();
            // eliminate duplicated 
            foreach (String term in queryTerms)
            {
                if (!uniqueQueryTerms.Contains(term))
                    uniqueQueryTerms.Add(term);
            }

            return uniqueQueryTerms;
        }
    }
}